define(["require", "exports", "../../lib/mve-DOM/index", "../../lib/mve/childrenBuilder"], function (require, exports, index_1, childrenBuilder_1) {
    "use strict";
    exports.__esModule = true;
    exports.testDomNode = exports.isInPage = void 0;
    function isInPage(node) {
        return (node === document.body) ? false : document.body.contains(node);
    }
    exports.isInPage = isInPage;
    function onDomLog(v, s) {
        if (isInPage(v)) {
            console.log(s, "在DOM上");
        }
        else {
            console.error(s, "不在DOM上");
        }
    }
    function testDomNode() {
        var firstDIV;
        var secondDIV;
        return (0, childrenBuilder_1.fragment)({
            init: function () {
                console.log("childLife初始化");
                return function () {
                    console.log("childLife销毁");
                };
            },
            children: [
                (0, index_1.dom)({
                    type: "div",
                    init: function (a) {
                        firstDIV = a;
                        onDomLog(firstDIV, "第一个初始化");
                        return function () {
                            onDomLog(firstDIV, "第一个销毁");
                        };
                    }
                }),
                (0, index_1.dom)({
                    type: "div",
                    init: function (b) {
                        secondDIV = b;
                        onDomLog(secondDIV, "第二个初始化");
                        return function () {
                            onDomLog(secondDIV, "第二个销毁");
                        };
                    }
                })
            ]
        });
    }
    exports.testDomNode = testDomNode;
});
